package com.java83.controller;


import com.java83.entity.RbacPerm;
import com.java83.service.RbacPermService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/perm")
public class RbacPermController {
    @Autowired
    RbacPermService rbacPermService;
    /**
     * 通过角色id数组，来查询中间表，然后再通过中间表查出所有权限
     * @param roles
     * @return
     */
    @RequestMapping("/findAllPerm")
    public List<RbacPerm>  findAllPerm(@RequestBody int[] roles){
      return   rbacPermService.findAllPerms(roles);
    }
}
